<script type="text/javascript" src="<?php echo $this->baseUrl;?>/library/ckeditor/ckeditor.js"></script>

<div id="titleTop" style="padding-top: 9px;">
	<div align="left">
		<?php if(!empty($this->errMsg)) :?>
			<?php $this->listError($this->errMsg,$this->lang_data); ?>
		<?php endif; ?>
	</div>
	<div class="titleTop-title"> <?php echo $this->lang_data->_("Add new solution");?> </div>
	<div class="clearDiv"></div>
</div>

<div id="form">
<form id="formIndex" action="<?php echo $this->baseUrl; ?>/backend/solution/add" method="post" enctype="multipart/form-data">

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	  <tr align="left">
		<td width="23"  class="form-header">&nbsp;</td>
		<td width="170" class="form-nameTitle"><?php print  $this->lang_data->_('Solution Detail');?> </td>
		<td class="form-header">&nbsp;</td>
	  </tr>
	  <tr>
	  	<td class="form-row01">&nbsp; </td>
		<td class="form-name1"> <?php print  $this->lang_data->_('Vietnamese Name') ?> :</td>
	    <td class="form-row01"><input type="text"  class="textBox" name="name_vn" id="name_vn" value="" /></td>
	  </tr>
          <tr>
	  	<td class="form-row01">&nbsp; </td>
		<td class="form-name1"> <?php print  $this->lang_data->_('English Name') ?> :</td>
	    <td class="form-row01"><input type="text"  class="textBox" name="name_en" id="name_en" value="" /></td>
	  </tr>
	  <tr>
	  	<td class="form-row02"> &nbsp;</td>
		<td class="form-name2"><?php print  $this->lang_data->_('Vietnamese Description') ?> :</td>
		<td class="form-row02">
			<textarea class="ckeditor" id="description_vn" name="description_vn" rows="15" cols="93" style="width: 100%">
				
			</textarea>
		</td>
	  </tr>
          <tr>
	  	<td class="form-row02"> &nbsp;</td>
		<td class="form-name2"><?php print  $this->lang_data->_('English Description') ?> :</td>
		<td class="form-row02">
			<textarea class="ckeditor" id="description_en" name="description_en" rows="15" cols="93" style="width: 100%">

			</textarea>
		</td>
	  </tr>
	  <tr>
	  	<td class="form-row02">&nbsp; </td>
		<td class="form-name2"><?php print  $this->lang_data->_('Image'); ?> :</td>
	    <td class="form-row02"><input type="file" name="image" id="image"></td>
	  </tr>
          <tr>
	  	<td class="form-row02">&nbsp; </td>
		<td class="form-name2"><?php print  $this->lang_data->_('Service types'); ?> :</td>
	    <td class="form-row02">
                <?php $this->listSelects($this,'service_types_id',$this->serviceTypes); ?>
            </td>
	  </tr>
          <tr>
	   	<td class="form-row02">&nbsp; </td>
		<td class="form-name2"><?php echo $this->lang_data->_('Active') ;?> :</td>
	    <td class="form-row02">
                <input type="radio" name="active" id="radActive" value="1" checked/> <?php echo $this->lang_data->_('Yes'); ?>
	    	<input type="radio" name="active" id="radActive" value="0" /> <?php echo $this->lang_data->_('No'); ?>
            </td>
	  </tr>
	  <tr>
	 	<td class="form-row02">&nbsp; </td>
		<td class="form-name2"></td>
	  	<td class="form-row02">
	  		<input type="submit" class="button" name="submit" id="submit" value="<?php print  $this->lang_data->_('OK'); ?>"/>
	  		<input type="reset"  class="button" name="reset"  id="reset"  value="<?php print  $this->lang_data->_('Reset'); ?>"/>
	  		<input type="button"  class="button" name="back"  id="back"  value="<?php print  $this->lang_data->_('Back'); ?>" onclick="window.location='<?php echo $this->baseUrl."/backend/solution"; ?>'"/>
	  	</td>
	  </tr>
	</table>
</form>
</div>
<div class="clearDiv"> </div>
<div style="height: 30px;"></div>
<script type="text/javascript">
$('#submit').click(function(){

    if(haveSpecialChars($('#name_vn').val()))
    {
        alert("Tên loại giải pháp không thể có ký tự đặc biệt");
        return false;
    }

    if(haveSpecialChars($('#name_en').val()))
    {
        alert("Tên loại giải pháp không thể có ký tự đặc biệt");
        return false;
    }

    if (isWhitespace($('#name_en').val()) && isWhitespace($('#name_vn').val()))
    {
        alert("Vui lòng nhập tên tiếng viêt hoặc tiếng anh.");
        return false;
    }

    if($('#image').val() == 0)
    {
        alert("Vui lòng chọn hình ảnh đại diện.");
        return false;
    }

    if($('#service_types_id').val() == 0)
    {
        alert("Vui lòng chọn loại dịch vụ");
        return false;
    }
    
})
</script>